$(function (){
    // 运行的函数
    submitLogin();
});

function submitLogin(){
    $("#logIn").click(function (){
        console.log("前端点击了登录按钮");
        $.ajax({
            url: "loginajax",
            type: "POST",
            contentType: "application/json;charset=utf-8",
            data: JSON.stringify({
                "account": $("#account").val(),
                "pwd": $("#pwd").val()
            }),
            dataType: "json",
            success: function (data){
                if (data.status === "success") {
                    alert("登录成功");
                }else{
                    alert(data.msg);
                }
            }
        })
    })
}